//
//  SwitchKeyBoardView.m
//  YZMicroStock
//
//  Created by apple on 2017/11/28.
//  Copyright © 2017年 cqjr. All rights reserved.
//

#import "SwitchKeyBoardView.h"

@interface SwitchKeyBoardView ()

@property (weak, nonatomic) IBOutlet UILabel *labelSwitchTitle;

@end

@implementation SwitchKeyBoardView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (IBAction)clickedBtnHiddenKeyBoard:(id)sender {
    [[UIApplication sharedApplication] sendAction:@selector(resignFirstResponder) to:nil from:nil forEvent:nil];
}

- (IBAction)clickedBtnSwitch:(id)sender {
    if (self.delegate && [self.delegate respondsToSelector:@selector(switchKeyBoardWith:)]) {
        if ([self.labelSwitchTitle.text isEqualToString:@"中文输入"]) {
            self.labelSwitchTitle.text = customInputTitle;
            [self.delegate switchKeyBoardWith:SwitchKeyBoardTypeSystem];
        }else{
            self.labelSwitchTitle.text = systemInputTitle;
            [self.delegate switchKeyBoardWith:SwitchKeyBoardTypeCustom];
        }
    }
    
}

- (void)setSwitchTitle:(NSString *)switchTitle{
    self.labelSwitchTitle.text = switchTitle;
}

@end
